package com.example.springmvc250513.mapper;

import com.example.springmvc250513.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
    /**
     * 查询所有留言
     */
    @Select("select *from message_info where delete_flag = 0")
    List<MessageInfo> queryMessage();

    /**
     * 插入留言信息
     * @param messageInfo
     * @return
     */
    @Insert("insert into message_info(`from`,`to`, `message`) values (#{from}, #{to}, #{message})")
    Integer inserMessage(MessageInfo messageInfo);
}
